import Home from "@/views/03_views_name_route命名路由/Home.vue";
import About from "@/views/03_views_name_route命名路由/About.vue";

import {createRouter , createWebHistory} from 'vue-router'
import Bar from "@/views/03_views_name_route命名路由/Bar.vue";
import Foo from "@/views/03_views_name_route命名路由/Foo.vue";
import Baz from "@/views/03_views_name_route命名路由/Baz.vue";

//1：定义路由
const routes = [
    {
        path: '/',
        component: Home
    },
    {
        path: '/about',
        component: About,
        children: [
            {
                path: 'bar',
                name: 'bar',
                components:{
                    default: Bar,
                    baz: Baz
                },
                meta:{auth:false}
            },
            {
                path: 'foo/:id',
                name: 'foo',
                component: Foo,
                meta:{auth:true}
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

//2：导出
export default router;
